<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.*,app.stock.common.*,app.stock.web.*, app.stock.server.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><%=Transaction.label%></title>
<%@ include file="head.jsp"%>
<%@ include file="js.jsp"%>
<script type="text/javascript">
	/*Ext.onReady(function() {
		var md = new Ext.form.DateField( {
			applyTo : '<%=Transaction.dateName%>',
			width : 153,
			format : 'Y-m-d H:i:s',
			emptyText : '请选择日期 ...'
		});
	});*/
</script>
</head>
<body>
<%@ include file="bodyhead.jsp"%>
<%
	String id = request.getParameter("id");
	StockManager sm = new StockManager();
	Transaction tx = sm.getTransactionByID(Integer.parseInt(id));
%>
<form name='edit_form' method="post" onsubmit="submitForm('edit_form',['page=transaction_edit.jsp','action=update','id=<%=id%>'])" action="">
<table>
	<tbody>
		<tr>
			<td><label><%=Transaction.dateLabel%></label></td>
			<td><input id="<%=Transaction.dateName%>" name="<%=Transaction.dateName%>" value="<%=Util.toDefaultDateFormat(tx.date)%>"></input></td>
		</tr>
		<tr>
			<td><label><%=Transaction.typeLabel%></label></td>
			<td><input name="<%=Transaction.typeName%>" value="<%=tx.type%>"></input></td>
		</tr>
		<tr>
			<td><label><%=Transaction.codeLabel%></label></td>
			<td><input name="<%=Transaction.codeName%>" value="<%=tx.code%>" onchange="setStockName()"></input></td>
		</tr>
		<tr>
			<td><label><%=Transaction.nameLabel%></label></td>
			<td><input name="<%=Transaction.nameName%>" value="<%=tx.name%>"></input></td>
		</tr>
		<tr>
			<td><label><%=Transaction.priceLabel%></label></td>
			<td><input name="<%=Transaction.priceName%>" value="<%=tx.price%>" onchange="calcSum()"></input></td>
		</tr>
		<tr>
			<td><label><%=Transaction.amountLabel%></label></td>
			<td><input name="<%=Transaction.amountName%>" value="<%=tx.amount%>" onchange="calcSum()"></input></td>
		</tr>
		<tr>
			<td><label><%=Transaction.sum1Label%></label></td>
			<td><input name="<%=Transaction.sum1Name%>" value="<%=tx.sum1%>"></input></td>
		</tr>
		<tr>
			<td><label><%=Transaction.shouxufeiLabel%></label></td>
			<td><input name="<%=Transaction.shouxufeiName%>" value="<%=tx.shouxufei%>" onchange="calcSum()"></input></td>
		</tr>
		<tr>
			<td><label><%=Transaction.yinhuashuiLabel%></label></td>
			<td><input name="<%=Transaction.yinhuashuiName%>" value="<%=tx.yinhuashui%>" onchange="calcSum()"></input></td>
		</tr>
		<tr>
			<td><label><%=Transaction.guohufeiLabel%></label></td>
			<td><input name="<%=Transaction.guohufeiName%>" value="<%=tx.guohufei%>" onchange="calcSum()"></input></td>
		</tr>
		<tr>
			<td><label><%=Transaction.sum2Label%></label></td>
			<td><input name="<%=Transaction.sum2Name%>" value="<%=tx.sum2%>"></input></td>
		</tr>
	</tbody>
</table>
<input name="submit" type="submit" value="<%=Constants.label_operationSave%>"></input> 
<input name="reset" type="reset" value="<%=Constants.label_operationReset%>">
</form>
</body>
</html>